package com.xinwei.shard.exception;

import com.xinwei.shard.enums.ResultEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@ToString(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class TokenException extends RuntimeException {

    //错误码
    private Integer errorCode;
    // 错误信息
    private String errorMsg;

    public TokenException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.errorCode = resultEnum.getCode();
        this.errorMsg = resultEnum.getMessage();
    }

}